
public class regex {

	public static void main(String[] args) {
		
		if ("123".matches("\\d*")){
			double temp = Double.parseDouble("123");
			
			if (temp < 999.0 && temp > 0.0 ) {
				System.out.println("OK");
			} else {
				System.out.println("NOK");
			}
		}
	}

}
